<?php

 


require_once 'PHPUnit/Framework.php';
require_once 'PHPUnit/Util/Filter.php';
require_once 'PHPUnit/Util/Type.php';

PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');


class PHPUnit_Framework_Constraint_PCREMatch extends PHPUnit_Framework_Constraint
{
    private $pattern;

    public function __construct($pattern)
    {
        $this->pattern = $pattern;
    }

    
    public function evaluate($other)
    {
        return preg_match($this->pattern, $other) > 0;
    }

    
    public function toString()
    {
        return sprintf(
          'matches PCRE pattern "%s"',

          $this->pattern
        );
    }
}
?>
